#pragma once
#include <string>
#include <vector>
#include <map>
#include "utMessage.pb.h"



class ClientSession;

//class Player
//{
//private:
//	std::string m_strId;
//
//	ClientSession *m_pClientSession;
//
//};


class PlayerManager
{
public:
	static PlayerManager &getInstance(){static PlayerManager sPlayerManager; return sPlayerManager;}

	bool IsPlayerExist(const std::string &strName);

	int GetAllPlayer(std::vector<std::string> &vecPlayerName);
	
	int GetPlayer(const std::string &strName, utgame::PlayerInfo &playerInfo);
	std::string AddPlayer(const std::string &strName, const std::string &strPwd);

private:
	PlayerManager();

private:

	std::map<std::string, ClientSession *> m_mapPlayer;
};

